#ifndef SMASTRATEGY_H
#define SMASTRATEGY_H
#include "strategy.h"

// 简单移动平均线策略实现
class SMAStrategy : public Strategy {
public:
    SMAStrategy(int shortPeriod = 5, int longPeriod = 20)
        : m_shortPeriod(shortPeriod), m_longPeriod(longPeriod) {}

    void setParameters(int shortPeriod, int longPeriod);

    void onCandle(const CandleData& candle) override ;
private:
    int m_shortPeriod;
    int m_longPeriod;
    QVector<double> m_prices;
    double m_lastShortSMA = 0.0;
    double m_lastLongSMA = 0.0;
};


#endif // SMASTRATEGY_H
